home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / docs / gmouse.doc < prev    next >
Text File  |  1994-03-28  |  48KB  |  1,503 lines

  1.  
  2.              PROGRAMMER'S  REFERENCE  FOR  GENIUS  MOUSE  DRIVER
  3.  
  4. *** 1 : BRIEF DESCRIPTION
  5.  
  6. The Genius Mouse Driver enables you to use mouse hardware to move an on-screen
  7. cursor and control its movement through a software program.  Various functions
  8. allow you to determine cursor placement, cursor shape, and button status.
  9.  
  10. In order for you to interface your Genius Mouse with an application program, the
  11. following information on the Genius Driver has been provided.
  12.  
  13. *** 2 : GRAPHICS AND TEXT CURSORS
  14.  
  15. GMOUSE Driver supports a hardware text cursor,  a software  text   cursor, and
  16. a graphics cursor. A hardware text cursor is a blinking cursor which moves from
  17. one character to another on-screen. This blinking cursor may take the form of a
  18. block or underscore. A software text cursor makes use of display attributes to
  19. change the visual appearance of a character on-screen.  Movement is from
  20. character to character. A graphics cursor is a shape that moves over on-screen
  21. images.
  22.  
  23. You can choose any of these three cursors to use on-screen, however, only one
  24. cursor can be displayed at a given time.  Also, within your application program,
  25. you can switch back and forth between cursors.
  26.  
  27.  
  28. Display the Graphics Cursor
  29.  
  30. The cursor appears on-screen or disappears from the screen through the calling
  31. program.  This cursor consists of a block of pixels.  As this block moves
  32. on-screen and affects the pixels beneath it, the cursor shape and background are
  33. created. This interaction is defined by two 16-by-16 bit arrays;
  34. one is the screen mask and the other is the cursor mask. The screen mask
  35. determines what part of the cursor pixel is to be the shape, and what part  is
  36. is to be the background. The cursor mask determines which pixels contribute to
  37. the color of the cursor. Whenever changes are made to the screen which lie
  38. directly  beneath the cursor, the cursor should be concealed so that old values
  39. are not restored to the screen.
  40.  
  41. Please note that with a high resolution mode, you have a 16-by-16 pixel block;
  42. with a medium resolution (four color) mode, you have a 8-by-16 pixel block; with
  43. a medium resolution (sixteen color) mode, you have a 4-by-16 pixel block.
  44.  
  45. Refer to function 9.
  46.  
  47. To create the cursor, the software uses data from the computer's screen memory
  48. which defines the color of each pixel on-screen.  Operations are performed that
  49. affect individual screen bits.  Software ANDs the screen mask defining the
  50. pixels under the cursor and XORs the cursor mask with the result of the AND
  51. operation.
  52.  
  53. Note the results when:
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                  page 1
  61.  
  62. Screen Mask Bit is      Cursor Mask Bit is      Resulting Screen Bit is
  63. ------------------      ------------------      -----------------------
  64.         0                        0                         0
  65.         0                        1                         1
  66.         1                        0                     unchanged
  67.         1                        1                      inverted
  68.  
  69. With each mouse function, a reference to the graphics cursor location is in
  70. reference to a point on-screen directly beneath the cursor.  This point that the
  71. mouse software uses to determine the cursor coordinates is known as the cursor's
  72. hot spot.
  73. Generally, the upper_left hand corner of the cursor block is designated as the
  74. coordinates for the cursor default value. ((0,0) are the upper_left hand corner
  75. coordinates.)
  76.  
  77. Software Text Cursor
  78.  
  79. You can use this text cursor when your computer is in one of the text modes.  By
  80. changing the character attributes beneath the cursor, the appearance of the
  81. character is influenced on-screen.  This effect on the text cursor can be
  82. defined by two 16-bit mask values. These bits can be described as follows:
  83. bit 15 sets the blinking (1) or non-blinking (0) character ; bit 12 - 14 set the
  84. background (1); bits 8 - 10 set the foreground color; and bits 0 - 7 set the
  85. character code. These values in the screen mask and the cursor mask
  86. determine the character's new attributes when the cursor is covering the
  87. character.  The screen mask decides which of the character's attributes are
  88. maintained. The cursor mask decides in what manner the attributes are altered
  89. to produce the cursor.
  90.  
  91. In creating this cursor, the software works from data which defines each
  92. character on the screen.  The software first ANDs the screen mask and the screen
  93. data bit for the character beneath the cursor.  Next, the software XORs the
  94. cursor mask and the result of the AND operation.
  95.  
  96. When a function refers to the text cursor location, it gives the coordinates of
  97. the character beneath the cursor.
  98.  
  99. Refer  to function 10.
  100.  
  101. Hardware Text Cursor
  102.  
  103. This cursor is also available when the computer is in one of the text modes.
  104. This cursor is the one seen on-screen when the computer is powered on.  It
  105. consists of 8 pixels wide and 8 to 14 pixels tall.  Software allows you to use
  106. this cursor for your needs. Scan lines determine a cursor's appearance
  107. on-screen. A scan line consists of a horizontal set of pixels.
  108. If a line is on, there will be flashing on the screen. If a line is off, there
  109. is no effect. Scan lines are numbered from 0 to 7, or 0 to 11 depending on the
  110. type of display used. 0 indicates the top scan line.
  111.  
  112. Refer to function 10.
  113.  
  114. *** 2.1 : Mouse Buttons
  115.  
  116.  
  117.  
  118.  
  119.  
  120.                                  page 2
  121.  
  122. Mouse functions can give the status of the mouse buttons and the number of times
  123. a certain button has been pressed and released.  The button status is given as
  124. an integer. If a bit is set to 1 the button is down; if a bit is set to 0, the
  125. button is up.
  126.       Bit 0 - Left Button Status
  127.       Bit 1 - Right Button Status
  128.       Bit 2 - Middle Button Status
  129. Each time a mouse button is pressed, a counter records the number of presses and
  130. releases.  The software sets the counter to zero once it has been read or after
  131. a reset.
  132.  
  133. *** 2.2 : Unit of Distance - Mouse Motion
  134.  
  135. The motion of the mouse can be expressed in a unit of distance (mouse motion)
  136. and is approximately 1/200 of an inch.
  137.  
  138. With mouse movement, mouse software determines a horizontal and vertical mouse
  139. motion count.  This count is used by the software to move a cursor a certain
  140. number of pixels on-screen.  Software defines mouse motion sensitivity (the
  141. number of mouse motions needed to move the cursor 8 pixels on-screen) and this
  142. sensitivity determines the rate at which the cursor moves on-screen.
  143.  
  144. Refer to function 15.
  145.  
  146. *** 2.3 : Internal Cursor Flag
  147.  
  148. Mouse software supports an internal flag.  This flag determines when the cursor
  149. should appear on-screen.  If the flag equals 0, the cursor appears on-screen; if
  150. the flag is any other number, the cursor disappears from the screen.
  151.  
  152. You can call functions 1 and 2 a number of times, however, if you call function
  153. 2, you must call function 1 later.  This is necessary to restore the flag's
  154. previous value.
  155.  
  156. Refer to functions 1 and 2.
  157.  
  158. *** 3 : CALLING FROM ASSEMBLY LANGUAGE PROGRAMS
  159.  
  160. To make mouse function calls:
  161.  
  162. Load the appropriate registers (AX, BX, CX, DX) with the parameter values.
  163. These correspond to G1%, G2%, G3%, and G4% as shown in the BASIC example to
  164. follow.  Then execute software interrupt 51 (33H).  The values given by the
  165. mouse functions will be installed in the registers.
  166.  
  167. Example:
  168.  
  169.    ; * set cursor to location (150,100)
  170.    Mov AX,4    ;(function call 4)
  171.    Mov CX,150  ;(set horizontal to 150)
  172.    Mov DX,100  ;(set vertical to 100)
  173.    Int 51(33H) ;(interrupt to mouse)
  174.  
  175. It is important to note that before using INT 33H, one should verify the
  176. presence of the mouse driver.  Executing an INT 33H will cause uncertain results
  177. if the mouse driver is not loaded.  Assume a mouse driver is present when INT
  178. 33H vector is non-zero and the vector does not point to an IRET instruction.
  179.  
  180.                                  page 3
  181.  
  182. Note:  When making a mouse call in Assembly Language, expect somewhat of a
  183. different value for the fourth parameter (when compared with calls using a BASIC
  184. program) involving functions 9, 12, and 16.
  185.  
  186. *** 4 : CALLING FROM BASIC LANGUAGE PROGRAM
  187.  
  188. To make  mouse function calls:
  189.  
  190.   Set a pair of integer variables in your program for the offset and the segment
  191.   of the mouse driver entry point.
  192.  
  193.   In order to obtain the offset and segment values, the following statements
  194.   must be inserted into your program before any calls to mouse functions:
  195.  
  196. 10 DEF SEG = 0
  197. 15 ' GET GMOUSE ENTRY POINT
  198. 20 GMSEG   = PEEK( 51*4 + 2 ) + 256 * PEEK( 51*4 + 3 )   ' GET SEGMENT ENTRY
  199. 30 GMOUSE  = 2 + PEEK( 51*4 ) + 256 * PEEK( 51*4 + 1 )   ' GET OFFSET  ENTRY
  200. 40 DEF SEG = GMSEG           ' SET SEGMENT REGISTER AS THE SEGMENT OF GMOUSE
  201.  
  202. To enter the mouse driver, use the CALL statement:
  203.  
  204.   CALL GMOUSE (G1%, G2%, G3%, G4%)
  205.  
  206. GMOUSE contains the entry offset of the mouse driver.  G1%, G2%, G3%, and G4%
  207. are the integer variables given in the call.  These four must be specified in
  208. the CALL statement even if a value is not assigned.  When a value is assigned,
  209. it must be an integer, that is, a whole number.
  210.  
  211. Example:
  212.  
  213. 50  ' Find the Activated Mode of Genius Mouse
  214. 60  G1% = 0 : G2% = 0
  215. 70  CALL GMOUSE ( G1%, G2%, G3%, G4% )
  216. 80  IF G2% AND 2 THEN PRINT "Genius Mouse ( 2_Button Mode ) Enable"
  217. 90  IF G2% AND 3 THEN PRINT "Genius Mouse ( 3_Button Mode ) Enable"
  218. 100 IF NOT G1%   THEN PRINT "Can't Find Genius Mouse"
  219.  
  220. *** 5 : MOUSE FUNCTIONS
  221.  
  222. These functions listed apply to the Genius Mouse.  Further descriptions of each
  223. mouse function will be given in the following pages.
  224.  
  225. Functions                                         Function Number
  226. -----------------------------------------------------------------
  227. Reset Genius Mouse Driver                                 0
  228. Enable Cursor Display                                     1
  229. Disable Cursor Display                                    2
  230. Read Cursor Location & Button State of Genius Mouse       3
  231. Set Cursor Location of Genius Mouse                       4
  232. Read Button Press State of Genius Mouse                   5
  233. Read Button Release State of Genius Mouse                 6
  234. Define Horizontal (X) Range of Cursor Location            7
  235. Define Vertical (Y) Range of Cursor Location              8
  236. Define Graphics Mode Cursor Style                         9
  237. Define Text Mode Cursor Style                            10
  238. Read Genius Mouse Motion Number                          11
  239.  
  240.                                  page 4
  241.  
  242. Define Event Handler Entry Location                      12
  243. Enable Light Pen Emulation Function                      13
  244. Disable Light Pen Emulation Function                     14
  245. Define Sensitivity (Mouse Motion/Pixel) of Genius Mouse  15
  246. Disable Cursor Display in Special Range                  16
  247. Define Double-Speed Threshold                            19
  248. Swap Event Handler Entry Location                        20
  249. Get Mouse Driver State Storage Size                      21
  250. Save Mouse Driver state                                  22
  251. Restore Mouse Driver state                               23
  252. Set CRT Page Number                                      29
  253. Read CRT Page Number                                     30
  254.  
  255. EGA functions are described in Section *** 7.
  256.  
  257. *** 6 : DESCRIPTION OF THE MOUSE FUNCTIONS
  258.  
  259. You'll notice that with the following mouse function descriptions, the
  260. parameters needed to make the calls and the expected outcome (return) for each
  261. is indicated. Also,  any special conditions regarding any of the mouse functions
  262. have been included.  Further, an example of a program has been provided in order
  263. for you to understand how to make the call.
  264.  
  265. The input and return values are presented for 8086 registers and for BASIC in
  266. the following pages.
  267.  
  268. It is important to note that each mouse function call needs four parameters.
  269. The Genius Mouse software does not verify any input values, and therefore, if
  270. any incorrect values are given, uncertain results will occur.
  271.  
  272. Function 0: Reset Genius Mouse Driver
  273.  
  274. Function 0 gives the current status of the mouse hardware plus the current
  275. status of the mouse software.  The calling program is able to determine the
  276. presence of a mouse driver and/or a serial port.
  277.  
  278. This function resets the mouse driver to the following default status as
  279. indicated:
  280.  
  281. Variable                                Value
  282. ------------------------------------------------------------------------------
  283. internal cursor flag                    -1 (cursor concealed)
  284. graphics  cursor shape                  horizontal oval
  285. text cursor                             reverse video
  286. user-defined call mask                  all zeroes
  287. light pen emulation mode                enabled
  288. vertical mouse motion/pixel ratio       16 to 8
  289. horizontal mouse motion/pixel ratio     8 to 8
  290. vertical min/max cursor coordinates     0/current display mode y values minus 1
  291. horizontal min/max cursor coordinates   0/current display mode x values minus 1
  292.  
  293. 8086 Register
  294. Input:  AX = 0
  295. Return: AX = mouse state (-1: installed, 0: not installed)
  296.         BX = number of buttons (2 button mode, 3 button mode)
  297.  
  298.  
  299.  
  300.                                  page 5
  301.  
  302. BASIC
  303. Input:  G1% = 0
  304. Return: G1% = mouse state (-1: installed, 0: not installed)
  305.         G2% = number of buttons (2 button mode, 3 button mode)
  306.  
  307. Example:  Used initially to determine if the GMOUSE driver is present and to
  308.           reset GMOUSE.
  309.  
  310. 50  ' Find the Actived Mode of Genius Mouse
  311. 60  G1% = 0 : G2% = 0
  312. 70  CALL GMOUSE ( G1%, G2%, G3%, G4% )
  313. 80  IF G2% AND 2 THEN PRINT "Genius Mouse ( 2_Button Mode ) Enable"
  314. 90  IF G2% AND 3 THEN PRINT "Genius Mouse ( 3_Button Mode ) Enable"
  315. 100 IF NOT G1%   THEN PRINT "Can't Find Genius Mouse"
  316.  
  317. Function 1: Enable Cursor Display
  318.  
  319. Function 1 increments the internal cursor flag counter.  If the counter is zero,
  320. the cursor is enabled and appears on-screen.
  321.  
  322. The default value is -1 which indicates a concealed cursor.  Function 1 must be
  323. called to display the cursor.  In case the internal cursor flag is already zero,
  324. a call to this function produces no effect.
  325.  
  326. 8086 Register
  327. Input:  AX = 1
  328. Return: none
  329.  
  330. BASIC
  331. Input:  G1% = 1
  332. Return: none
  333.  
  334. Example:
  335.  
  336. 110  ' Enable Genius Mouse's Cursor
  337. 120  G1% = 1
  338. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  339.  
  340. Function 2: Disable Cursor Display
  341.  
  342. Function 2 disables the cursor by removing it from the screen and decrementing
  343. the internal cursor flag.  Even though the cursor cannot be seen, it still
  344. tracks any motion made with the mouse.
  345.  
  346. You should use this function before changing any portion of the screen
  347. containing the cursor.  You will avoid the problem of the cursor affecting
  348. screen data.
  349.  
  350. Keep in mind that whenever your program calls function 2, it must later call
  351. function 1 to return the internal cursor flag to its default value.  In
  352. addition, if your program changes the screen mode, function 2 is called
  353. automatically. Therefore, the cursor's movement is enabled the next time it is
  354. displayed.
  355.  
  356. Call function 2 at the end of a program in order to conceal the cursor.  This
  357. ensures that nothing remains on-screen.
  358.  
  359.  
  360.                                  page 6
  361.  
  362. 8086 Register
  363. Input:  AX = 2
  364. Return: none
  365.  
  366. BASIC
  367. Input:  G1% = 2
  368. Return: none
  369.  
  370. Example:
  371.  
  372. 110  ' Disable Genius Mouse's Cursor
  373. 120  G1% = 2
  374. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  375.  
  376. Function 3: Read Cursor Location & Button State of Genius Mouse
  377.  
  378. Function 3 gives the status of mouse buttons, plus cursor location.
  379.  
  380. Button status consists of a single integer value:
  381.   Bit 0 = left button (2 button mode, 3 button mode)
  382.   Bit 1 = right button (2 button mode, 3 button mode)
  383.   Bit 2 = middle button (3 button mode)
  384.  
  385. The bit is 1 when the button is pressed.  The bit is 0 when the button is
  386. released.
  387.  
  388. 8086 Register
  389. Input:  AX = 3
  390. Return: BX = button status
  391.         CX = horizontal cursor coordinate
  392.         DX = vertical cursor coordinate
  393.  
  394. BASIC
  395. Input:  G1% = 3
  396. Return: G2% = button status
  397.         G3% = horizontal cursor coordinate
  398.         G4% = vertical cursor coordinate
  399.  
  400. Example:
  401.  
  402. 110  ' Read Genius Mouse Location & Button State
  403. 120  G1% = 3
  404. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  405. 140 PRINT "Genius Mouse Location : X_Coord=" G3% " Y_Coord=" G4%
  406. 150 IF G2% AND 1 THEN PRINT "Left Button"
  407. 160 IF G2% AND 2 THEN PRINT "Right Button"
  408. 170 IF G2% AND 4 THEN PRINT "Middle Button"
  409. 180 PRINT "Pressed"
  410.  
  411. Function 4: Set Cursor Location of Genius Mouse
  412.  
  413. Function 4 sets the current cursor location.  Values must be within the
  414. coordinate ranges for the virtual screen and, if necessary, are rounded to the
  415. nearest values allowed for the current screen mode.
  416.  
  417.  
  418.  
  419.  
  420.                                  page 7
  421.  
  422.   Screen     Display        Virtual         Cell        Bits/Pixel
  423.    Mode      Adapter       Screen (XxY)     Size      Graphics Mode
  424. ---------  ------------  ---------------  --------   ----------------
  425.     0      C, E, 3270     640 x 200        16 x 8          -
  426.     1      C, E, 3270     640 x 200        16 x 8          -
  427.     2      C, E, 3270     640 x 200         8 x 8          -
  428.     3      C, E, 3270     640 x 200         8 x 8          -
  429.     4      C, E, 3270     640 x 200         2 x 1          2
  430.     5      C, E, 3270     640 x 200         2 x 1          2
  431.     6      C, E, 3270     640 x 200         1 x 1          1
  432.     7      M, E, 3270     640 x 200         8 x 8          -
  433.     D      E              640 x 200        16 x 8          2
  434.     E      E              640 x 200         1 x 1          1
  435.     F      E              640 x 350         1 x 1          1
  436.     10     E              640 x 350         1 x 1          1
  437.     30     3270           720 x 350         1 x 1          1
  438.            H              720 x 348         1 x 1          1
  439.  
  440. Display Adapter:
  441.   M = IBM Monochrome Display/Printer Adapter
  442.   C = IBM Color/Graphics Adapter
  443.   E = IBM Enhanced Graphics Adapter
  444. 3270 = IBM All Points Addressable Graphics Adapter (3270 PC)
  445.   H = Hercules Monochrome Graphics Card
  446.  
  447. 8086 Register
  448. Input:  AX = 4
  449.         CX = new horizontal cursor coordinate
  450.         DX = new vertical cursor coordinate
  451. Return: none
  452.  
  453. BASIC
  454. Input:  G1% = 4
  455.         G3% = new horizontal cursor coordinate
  456.         G4% = new vertical cursor coordinate
  457. Return: none
  458.  
  459. Example:
  460.  
  461. 110  ' Set Cursor Location at the Upper_Left Corner of Screen
  462. 120 G1% = 4
  463. 130 G3% = 0 : G4% = 0
  464. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  465.  
  466. Function 5: Read Button Press State of Genius Mouse
  467.  
  468. Function 5 provides status on the specified button, gives the number of button
  469. presses since the last call, and produces the location of the cursor at last
  470. button press.
  471.  
  472. Button status consists of a single integer value.  Again, as in function 3:
  473.              Bit 0 = left button (2 button mode, 3 button mode)
  474.              Bit 1 = right button (2 button mode, 3 button mode)
  475.              Bit 2 = middle button (3 button mode)
  476.  
  477. The bit is 1 when the button is pressed.  The bit is 0 when the button is
  478. released.
  479.  
  480.                                  page 8
  481.  
  482. The number of button presses will always fall in the range of 0 to 32767.  There
  483. is no indicator for overflow.  Following this function call, the count is reset
  484. to zero.
  485.  
  486. 8086 Register
  487. Input:  AX = 5
  488.         BX = button status (left = 0, right = 1, middle = 2)
  489. Return: AX = button status
  490.         BX = number of button presses
  491.         CX = horizontal cursor coordinate at last press
  492.         DX = vertical cursor coordinate at last press
  493.  
  494. BASIC
  495. Input:  G1% = 5
  496.         G2% = button status (left = 0, right = 1, middle = 2)
  497. Return: G1% = button status
  498.         G2% = number of button presses
  499.         G3% = horizontal cursor coordinate at last press
  500.         G4% = vertical cursor coordinate at last press
  501.  
  502. Example:
  503.  
  504. 110 ' Read the Left Button Press State of Genius Mouse
  505. 120 G1% = 5 : G2% = 2
  506. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  507. 140 IF G1% AND 2 THEN PRINT "The Middle Button Pressed at X_loc=" G3%
  508.  
  509. Function 6: Read Button Release State of Genius Mouse
  510.  
  511. Function 6 provides status on the specified button, gives the number of button
  512. releases since the last call, and provides the location of the cursor at the
  513. last button release.
  514.  
  515. Button status consists of a single integer value.  Again, as in function 3:
  516.              Bit 0 = left button (2 button mode, 3 button mode)
  517.              Bit 1 = right button (2 button mode, 3 button mode)
  518.              Bit 2 = middle button (3 button mode)
  519.  
  520. The bit is 1 when the button is pressed.  The bit is 0 when the button is
  521. released.
  522.  
  523. The number of button releases will always fall in the range of 0 to 32767.
  524. There is no indicator for overflow.  Following this function call, the count is
  525. reset to zero.
  526.  
  527. 8086 Register
  528. Input:  AX = 6
  529.         BX = button status (left = 0, right = 1, middle = 2)
  530. Return: AX = button status
  531.         BX = number of button releases
  532.         CX = horizontal cursor coordinate at last release
  533.         DX = vertical cursor coordinate at last release
  534.  
  535. BASIC
  536. Input:  G1% = 6
  537.         G2% = button status (left = 0, right = 1, middle = 2)
  538.  
  539.  
  540.                                  page 9
  541.  
  542. Return: G1% = button status
  543.         G2% = number of button releases
  544.         G3% = horizontal cursor coordinate at last release
  545.         G4% = vertical cursor coordinate at last release
  546.  
  547. Example:
  548.  
  549. 110 ' Read the Left Button Release State of Genius Mouse
  550. 120 G1% = 6 : G2% = 2
  551. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  552. 140 IF NOT G1% OR &HFFFB THEN PRINT "The Middle Button Released at X_loc=" G3%
  553.  
  554. Function 7: Define Horizontal (X) Range of Cursor Location
  555.  
  556. Function 7 defines the horizontal range of the cursor on-screen.  As a result,
  557. cursor movement is limited to this specified area.  If a cursor happens to be
  558. outside of this area when a call is made, the cursor is moved to just inside the
  559. area.
  560.  
  561. 8086 Register
  562. Input:  AX = 7
  563.         CX = minimum horizontal cursor coordinate
  564.         DX = maximum horizontal cursor coordinate
  565. Return: none
  566.  
  567. BASIC
  568. Input:  G1% = 7
  569.         G3% = minimum horizontal cursor coordinate
  570.         G4% = maximum horizontal cursor coordinate
  571. Return: none
  572.  
  573. Example:
  574.  
  575. 110 ' Enable Cursor in Horizontal Range between 100 to 200
  576. 120 G1% = 7
  577. 130 G2% = 100 : G3% = 200
  578. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  579.  
  580. Function 8: Define Vertical (Y) Range of Cursor Location
  581.  
  582. Function 8 defines the vertical range of the cursor on-screen.  As a result,
  583. cursor movement is limited to this specified area.  If a cursor happens to be
  584. outside of this area when a call is made, the cursor is moved to just inside the
  585. area.
  586.  
  587. 8086 Register
  588. Input:  AX = 8
  589.         CX = minimum vertical cursor coordinate
  590.         DX = maximum vertical cursor coordinate
  591. Return: none
  592.  
  593. BASIC
  594. Input:  G1% = 8
  595.         G3% = minimum vertical cursor coordinate
  596.         G4% = maximum vertical cursor coordinate
  597. Return: none
  598.  
  599.  
  600.                                  page 10
  601.  
  602. Example:
  603.  
  604. 110 ' Enable Cursor in Vertical Range between 100 to 200
  605. 120 G1% = 8
  606. 130 G2% = 100 : G3% = 200
  607. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  608.  
  609. Function 9: Define Graphics Mode Cursor Style
  610.  
  611. Function 9 defines the style of the cursor in terms of color, shape, and center
  612. for the graphics.  As mentioned before, this cursor is a 16-by-16 pixel block
  613. and is defined by two 16-bit arrays (the screen mask bit and the cursor mask
  614. bit). Cursor coordinates for the hot spot must be in the range of -16 to +16.
  615. 8086 Register
  616. Input:  AX = 9
  617.         BX = horizontal cursor hot spot
  618.         CX = vertical cursor hot spot
  619.         DX = pointer to screen and cursor mask
  620. Return: none
  621.  
  622. BASIC
  623. Input:  G1% = 9
  624.         G2% = horizontal cursor hot spot
  625.         G3% = vertical cursor hot spot
  626.         G4% = pointer to screen and cursor mask
  627. Return: none
  628.  
  629. Example:
  630.  
  631. 10  ' Define the screen mask
  632. 20  '
  633. 30    cursor (0,0)  = &HFFFF       '1111111111111111
  634. 40    cursor (1,0)  = &HFFFF       '1111111111111111
  635. 50    cursor (2,0)  = &HFFFF       '1111111111111111
  636. 60    cursor (3,0)  = &HFFFF       '1111111111111111
  637. 70    cursor (4,0)  = &HFFFF       '1111111111111111
  638. 80    cursor (5,0)  = &HF00F       '1111000000001111
  639. 90    cursor (6,0)  = &H0000       '0000000000000000
  640. 100   cursor (7,0)  = &H0000       '0000000000000000
  641. 110   cursor (8,0)  = &H0000       '0000000000000000
  642. 120   cursor (9,0)  = &H0000       '0000000000000000
  643. 130   cursor (10,0) = &HF00F       '1111000000001111
  644. 140   cursor (11,0) = &HFFFF       '1111111111111111
  645. 150   cursor (12,0) = &HFFFF       '1111111111111111
  646. 160   cursor (13,0) = &HFFFF       '1111111111111111
  647. 170   cursor (14,0) = &HFFFF       '1111111111111111
  648. 180   cursor (15,0) = &HFFFF       '1111111111111111
  649. 190 '
  650. 200 ' Define the cursor mask
  651. 210 '
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.                                  page 11
  661.  
  662. 220   cursor (0,1)  = &H0000       '0000000000000000
  663. 230   cursor (1,1)  = &H0000       '0000000000000000
  664. 240   cursor (2,1)  = &H0000       '0000000000000000
  665. 250   cursor (3,1)  = &H0000       '0000000000000000
  666. 260   cursor (4,1)  = &H0000       '0000000000000000
  667. 270   cursor (5,1)  = &H0000       '0000000000000000
  668. 280   cursor (6,1)  = &H07E0       '0000011111100000
  669. 290   cursor (7,1)  = &H7FFE       '0111111111111110
  670. 300   cursor (8,1)  = &H7FFE       '0111111111111110
  671. 310   cursor (9,1)  = &H07E0       '0000011111100000
  672. 320   cursor (10,1) = &H0000       '0000000000000000
  673. 330   cursor (11,1) = &H0000       '0000000000000000
  674. 340   cursor (12,1) = &H0000       '0000000000000000
  675. 350   cursor (13,1) = &H0000       '0000000000000000
  676. 360   cursor (14,1) = &H0000       '0000000000000000
  677. 370   cursor (15,1) = &H0000       '0000000000000000
  678. 380 '
  679. 390 ' Set the cursor style and hot spot number of Genius Mouse
  680. 400 '
  681. 410 '
  682. 420   G1% = 9
  683. 430   G2% = 6 ' horizontal hot spot
  684. 440   G3% = 5 ' vertical hot spot
  685. 450   CALL GMOUSE ( G1%, G2%, G3%, cursor (0,0))
  686.  
  687. Function 10: Define Text Mode Cursor Style
  688.  
  689. Function 10 chooses the hardware or the software text cursor.
  690.  
  691. For example, if BX (G2%) is 1, the hardware cursor is selected and the hardware
  692. is set up with the first and last scan lines which define the cursor.
  693. (Values for CX (G3%) and DX (G4%) range from 0 to 7 for the color display and 0
  694. to 11 for the monochrome display.)
  695.  
  696. If BX (G2%) is 0, the software cursor is selected; and CX (G3%) and DX (G4%)
  697. must specify the screen and cursor masks.  (These masks give the attributes and
  698. character code of the cursor, and their values are dependent on the type of
  699. display in use.)
  700.  
  701. 8086 Register
  702. Input:  AX = 10
  703.         BX = select cursor (0: software text, 1: hardware text)
  704.         CX = screen mask value/scan line start
  705.         DX = cursor mask value/scan line stop
  706. Return: none
  707.  
  708. BASIC
  709. Input:  G1% = 10
  710.         G2% = select cursor (0: software text, 1: hardware text)
  711.         G3% = screen mask value/scan line start
  712.         G4% = cursor mask value/scan line stop
  713. Return: none
  714.  
  715. Example:
  716.  
  717.  
  718.  
  719.  
  720.                                  page 12
  721.  
  722. 110 ' Enable an Inverting Cursor
  723. 120 G1% = 10
  724. 130 G2% = 0
  725. 140 G3% = &HFFFF  :  G4% = &H7700
  726. 150 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  727.  
  728. Function 11: Read Genius Mouse Motion Number
  729.  
  730. Function 11 gives the mouse motion number since the last call.  A positive
  731. horizontal number indicates rightward movement (negative shows leftward
  732. movement).  A positive vertical number indicates downward movement (negative
  733. shows upward movement).
  734. The number is always in the range of -32768 to 32767.  Overflow is disregarded.
  735. Once the call is completed, the number is set to 0.
  736.  
  737. 8086 Registers
  738. Input:  AX = 11
  739. Return: CX = horizontal number
  740.         DX = vertical number
  741.  
  742. BASIC
  743. Input:  G1% = 11
  744. Return: G3% = horizontal number
  745.         G4% = vertical number
  746.  
  747. Example:
  748.  
  749. 110 ' Read Genius Mouse Motion Number
  750. 120 G1% = 11
  751. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  752. 140 IF G3% > 0 THEN PRINT "Genius Mouse is Moving to Right"
  753. 150 IF G4% > 0 THEN PRINT "Genius Mouse is Moving Down"
  754.  
  755. Function 12: Define Event Handler Entry Location
  756.  
  757. Function 12 defines the address entry location of an event handler routine which
  758. is called when a certain event (defined by the call mask) occurs.  The program
  759. is temporarily interrupted by the mouse driver. At the end of the event handler
  760. routine  the program continues at the point it was interrupted.
  761.  
  762. The call mask is a single integer value defining the conditions which will cause
  763. an interrupt.
  764.  
  765. A specific condition corresponds to a bit in the call mask:
  766.  
  767. Mask Bit                Condition
  768. --------------------------------------------------
  769.    0                    cursor location changed
  770.    1                    left button pressed
  771.    2                    left button released
  772.    3                    right button pressed
  773.    4                    right button released
  774.    5                    middle button pressed
  775.    6                    middle button released
  776.    7 - 15               not used
  777.  
  778.  
  779.  
  780.                                  page 13
  781.  
  782. In order to call the event handler routine, set the mask bit to 1 and put the
  783. mask in at CX (G3%).  To disable, set the mask bit to 0 and put the mask in at
  784. CX (G3%).  Always be sure to set the call mask to 0 before the program finishes.
  785. (Leave the system in the same state upon exit as if was upon entrance.)
  786.  
  787. 8086 Register
  788. Input:  AX = 12
  789.         CX = call mask
  790.         ES:DX = pointer to event handler routine
  791. Return: none
  792.  
  793. BASIC
  794. Input:  G1% = 12
  795.         G3% = call mask
  796.         G4% = pointer to event handler routine
  797. Return: none
  798.  
  799. Example:
  800.  
  801.  
  802. 110 ' Active BUTTDOWN Event Handler Routine, When One or More Buttons Pressed
  803. 120 G1% = 12
  804. 130 G3% = &H002A  :  G4% = BUTTDOWN%
  805. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  806.  
  807. Function 13: Enable Light Pen Emulation Function
  808.  
  809. Function 13 permits the mouse to act like a light pen.  When in this mode, calls
  810. to the pen function will give the cursor coordinates at the last pen down
  811. location.
  812.  
  813. Note that the status of "pen down" and "pen off-screen" is controlled by the
  814. mouse buttons:  all buttons up, pen off-screen; one button pressed, pen down.
  815.  
  816. Light pen emulation is ON after each call to function 0 (Reset Mouse Driver).
  817.  
  818. 8086 Register
  819. Input:  AX = 13
  820. Return: none
  821.  
  822. BASIC
  823. Input:  G1% = 13
  824. Return: none
  825.  
  826. Example:
  827.  
  828. 110 ' Enable Light Pen Emulation Function
  829. 120 G1% = 13
  830. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  831.  
  832. Function 14: Disable Light Pen Emulation Function
  833.  
  834. Function 14 turns off the light pen emulation mode.  When disabled, any call to
  835. the pen function will give information only about a real light pen.
  836.  
  837. 8086 Register
  838. Input:  AX = 14
  839.  
  840.                                  page 14
  841.  
  842. Return: none
  843.  
  844. BASIC
  845. Input:  G1% = 14
  846. Return: none
  847.  
  848. Example:
  849.  
  850. 110 ' Disable Light Pen Emulation Function
  851. 120 G1% = 14
  852. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  853.  
  854. Function 15: Define Sensitivity (Mouse Motion/Pixel) of Genius Mouse
  855.  
  856. Function 15 defines mouse sensitivity as determined by the mouse motion/pixel
  857. ratio.  This is a way of setting the amount of cursor motion wanted for mouse
  858. movement.  These ratios specify mouse motion per 8 pixels.  These values must
  859. be in the range of 1 to 32767.  With a larger ratio, the cursor movement is
  860. shortened for each mouse movement.
  861.  
  862. Default values:   horizontal ratio - 8  mouse motions to 8 pixels
  863.                   vertical ratio   - 16 mouse motions to 8 pixels
  864.  
  865. Note: 1 mouse motion = 1/200 of an inch increment
  866.  
  867. 8086 Register
  868. Input:  AX = 15
  869.         CX = horizontal mouse motion counts to pixel ratio
  870.         DX = vertical mouse motion counts to pixel ratio
  871. Return: none
  872.  
  873. BASIC
  874. Input:  G1% = 15
  875.         G3% = horizontal mouse motion counts to pixel ratio
  876.         G4% = vertical mouse motion counts to pixel ratio
  877. Return: none
  878.  
  879. Example:
  880.  
  881. 110 ' Define Horizontal Sensitivity as 8
  882. 120 ' Define Vertical Sensitivity as 16
  883. 130 G1% = 15
  884. 140 G3% =  8
  885. 150 G4% = 16
  886. 160 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  887.  
  888. Function 16: Disable Cursor Display in Special Range
  889.  
  890. Function 16 sets up a special range on-screen.  If the cursor moves to this area
  891. or is in this area, it will be disabled.  After a call is made to this function,
  892. it is necessary to call function 1 to enable the cursor again.
  893.  
  894. Define the special range with screen location values using four components:
  895.  
  896.  
  897.  
  898.  
  899.  
  900.                                  page 15
  901.  
  902. Components          Values
  903. --------------------------------------------------------
  904.     1               Left horizontal screen location
  905.     2               Upper vertical screen location
  906.     3               Right horizontal screen location
  907.     4               Lower vertical screen location
  908.  
  909. 8086 Register
  910. Input:  AX = 16
  911.         ES:DX = pointer to special range
  912. Return: none
  913.  
  914. BASIC
  915. Input:  G1% = 16
  916.         G4% = pointer to special range
  917. Return: none
  918.  
  919. Example:
  920.  
  921. 110 ' Disable Cursor Display in (0,0) to (100,100) Range
  922. 120 G1% = 16
  923. 130 RANGE%(1) = 0   : RANGE%(2) = 0
  924. 140 RANGE%(3) = 100 : RANGE%(4) = 100
  925. 150 CALL GMOUSE ( G1%, G2%, G3%, RANGE%(0) )
  926.  .
  927.  .
  928.  .
  929.  
  930. 500 ' Enable Cursor Display Again
  931. 510 G1% = 1
  932. 520 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  933.  
  934. Function 19: Define Double-Speed Threshold
  935.  
  936. Function 19 defines the threshold value (mouse motion per second) for doubling
  937. the cursor's motion.  Should the mouse move faster than the DX (G4%) value, the
  938. cursor motion doubles.  The default value is 64 mouse motions per second.
  939.  
  940. If you should want to disable double-speed, just set the threshold to 32767
  941. (7FFFH) mouse motions/second.
  942.  
  943. 8086 Register
  944. Input:  AX = 19
  945.         DX = threshold speed in mouse motions/second
  946. Return: none
  947.  
  948. BASIC
  949. Input:  G1% = 19
  950.         G4% = threshold speed in mouse motions/second
  951. Return: none
  952.  
  953. Example:
  954.  
  955. 110 ' Define Double-Speed Threshold as 20 Mouse Motions/Second
  956.  
  957.  
  958.  
  959.  
  960.                                  page 16
  961.  
  962. 120 G1% = 19
  963. 130 G4% = 20
  964. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  965. .
  966. .
  967. .
  968.  
  969. 500 ' Disable Double-Speed Threshold Function
  970. 510 G1% = 19
  971. 520 G4% = 256 'MAX. VALUE
  972. 530 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  973.  
  974. Function 20: Swap Event Handler Entry Location
  975.  
  976. Function 20 sets new values for the call mask and event handler routine
  977. address  for mouse  hardware interrupts and return the values that were
  978. previously specified.
  979.  
  980. For detail information to reference Function 12 description.
  981.  
  982. 8086 Register
  983. Input:  AX = 20
  984.         CX = new call mask
  985.         ES:DX = new pointer to event handler routine
  986. Return: CX = old call mask
  987.         ES:DX = old pointer to event handler routine
  988.  
  989. BASIC
  990. Input:  G1% = 20
  991.         G3% = call mask
  992.         G4% = pointer to event handler routine
  993. Return: G3% = old call mask
  994.         G4% = old pointer to event handler routine
  995.  
  996. Example:
  997.  
  998. 100 ' Swap Event Handler Entry Location
  999. 110 ' Active BUTTDOWN Event Handler Routine, When One or More Buttons Pressed
  1000. 120 G1% = 20
  1001. 130 G3% = &H002A  :  G4% = BUTTDOWN%
  1002. 140 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1003.  
  1004. Function 21: Get Mouse Driver State Storage Size
  1005.  
  1006. Function 21 returns the size of the buffer required to store the current state
  1007. of the  mouse  driver.  It is used with  functions 22  and 23 when you want to
  1008. temporarily  interrupt a program  that is using the mouse  and execute another
  1009. that also uses the mouse.
  1010.  
  1011. 8086 Register
  1012. Input:  AX = 21
  1013.  
  1014. Return: BX = buffer size required for mouse driver state
  1015.  
  1016. BASIC
  1017. Input:  G1% = 21
  1018.  
  1019.  
  1020.                                  page 17
  1021.  
  1022. Return: G2% = buffer size required for mouse driver state
  1023.  
  1024. Example:
  1025.  
  1026. 110 ' Get Mouse Driver State Storage Size
  1027. 120 G1% = 21
  1028. 130 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1029. 140 STATESIZE% = G2%
  1030.  
  1031. Function 22: Save Mouse Driver state
  1032.  
  1033. Function 22 saves the current mouse driver state in a buffer allocated by your
  1034. program.   It is used with  functions 21  and 23  when you want to temporarily
  1035. interrupt a program  that is using the mouse  and execute another program that
  1036. also uses the mouse.
  1037.  
  1038. Before your program  calls function 22, the program should call function 21 to
  1039. determine  the buffer size required  for saving the  mouse driver state,  then
  1040. allocate the appropriate amount of memory.
  1041.  
  1042. 8086 Register
  1043. Input:  AX = 22
  1044.         ES:DX = pointer to the buffer
  1045. Return: None
  1046.  
  1047. BASIC
  1048. Input:  G1% = 22
  1049.         G4% = pointer to the buffer
  1050. Return: None
  1051.  
  1052. Example:
  1053.  
  1054. 110 ' Save The Mouse Driver State
  1055. 120 G1% = 22
  1056. 130 G4% =  BUFPTR
  1057. 140 ' Assume BUFPTR contains the address of the buffer
  1058. 150 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1059.  
  1060. Function 23: Restore Mouse Driver State
  1061.  
  1062. Function 23 restores the last  mouse driver state saved by function 22.  It is
  1063. used with functions 21 and 22 when you want to temporarily interrupt a program
  1064. that is  using the mouse  and execute another program that also uses the mouse.
  1065. To restore the mouse driver state saved by function 22, call function 23 at the
  1066. end of the interrupt program.
  1067.  
  1068. 8086 Register
  1069. Input:  AX = 23
  1070.         ES:DX = pointer to the buffer
  1071. Return: None
  1072.  
  1073. BASIC
  1074. Input:  G1% = 23
  1075.         G4% = pointer to the buffer
  1076. Return: None
  1077.  
  1078. Example:
  1079.  
  1080.                                  page 18
  1081.  
  1082. 110 ' Restore The Mouse Driver State
  1083. 120 G1% = 23
  1084. 130 G4% =  BUFPTR
  1085. 140 ' Assume BUFPTR contains the address of the buffer
  1086. 150 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1087.  
  1088. Function 29: Set CRT Page Number
  1089.  
  1090. Function 29 specifies the CRT page on which the mouse cursor will be displayed.
  1091.  
  1092. For information on the number of CRT pages available in each display mode your
  1093. adapter supports, see the documentation that came with the graphics adapter.
  1094.  
  1095. 8086 Register
  1096. Input:  AX = 29
  1097.         BX = CRT page for mouse cursor display
  1098. Return: none
  1099.  
  1100. BASIC
  1101. Input:  G1% = 29
  1102.         G2% = CRT page for mouse cursor display
  1103. Return: none
  1104.  
  1105. Example:
  1106.  
  1107. 110 ; Set CRT page 2 for display mouse cursor
  1108. 120 G1% = 29
  1109. 130 G2% = 2
  1110. 140 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1111.  .
  1112.  .
  1113.  .
  1114.  
  1115. 500 ; Enable Cursor Display Again
  1116. 510 G1% = 1
  1117. 520 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1118.  
  1119. Function 30: Read CRT Page Number
  1120.  
  1121. Function 30 returns the number of the CRT page on which the mouse cursor is
  1122. displayed.
  1123.  
  1124. 8086 Register
  1125. Input:  AX = 30
  1126.  
  1127. Return: BX = CRT page number of current cursor display
  1128.  
  1129. BASIC
  1130. Input:  G1% = 30
  1131.  
  1132. Return: G2% = CRT page number of current cursor display
  1133.  
  1134. Example:
  1135.  
  1136. 110 ; Read CRT page number
  1137. 120 G1% = 30
  1138. 130 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1139.  
  1140.                                  page 19
  1141.  
  1142. *** 7 : USING GENIUS MOUSE WITH IBM ENHANCED GRAPHICS ADAPTER
  1143.  
  1144. Within the Genius Mouse driver, you'll find nine EGA functions.  These functions
  1145. permit your program to write to and read from write-only registers.
  1146.  
  1147. The cursor in use is defined as a monochrome cursor with one bit per pixel.  The
  1148. bit masks are determined by function 9 and apply to all active planes.
  1149.  
  1150. In order to make an EGA function call from an Assembly-Language program, first
  1151. load the AX, BX, CX, DX, and ES registers with the values indicated for the
  1152. parameters.  Note that five values must be given for a high level language
  1153. program.  Next, execute software interrupt 16 (10h). The values that are
  1154. returned are intalled in the registers by EGA functions.
  1155.  
  1156. Upon start with DOS, PC BIOS will verify if the EGA BIOS exists.  When this is
  1157. verified, the PC will execute the EGA BIOS, booting up the program to write the
  1158. INT 10h entry vector to the address of the INT 42h vector.  Now, EGA BIOS
  1159. address will be written to INT 10h. Following this, you are able to call EGA
  1160. BIOS (by using INT 10h) and PC video BIOS (by using INT 42h).
  1161.  
  1162. There are twenty functions in EGA BIOS.  (PC BIOS has only 16.) The EGA BIOS
  1163. routines only intercept the BIOS ROM video routines (INT 10h, AH = 13h or less).
  1164.  
  1165. The following indicates nine EGA functions and the corresponding function
  1166. number:
  1167.  
  1168. Function                                             Number (HEX)
  1169. -----------------------------------------------------------------
  1170. Retrieve Single Data                                       F0
  1171. Save Single Data                                           F1
  1172. Retrieve Registers on a Specified Port                     F2
  1173. Save Registers on a Specified Port                         F3
  1174. Retrieve Several Registers Data                            F4
  1175. Save Several Registers Data                                F5
  1176. Reset All Registers as Initial Values                      F6
  1177. Set Initial Values                                         F7
  1178. Get Version Number of Genius Mouse Driver                  FA
  1179.  
  1180. In the above functions, the EGA I/O port number and address are as follows:
  1181.  
  1182. Port No.  Register Name   No. of Registers  Index No.  Address Select Register
  1183. ------------------------------------------------------------------------------
  1184.  00H      CRT Controller         25           0 - 24            3x4H
  1185.  08H      Sequencer               5           0 - 4             3C4H
  1186.  10H      Graphics Controller     9           0 - 8             3CEH
  1187.  18H      Attribute Controlle    20           0 - 19            3C0H
  1188.           Singular Registers
  1189.  20H      Miscellaneous Output    1           ignored           3C2H
  1190.  28H      Feature Control         1           ignored           3xAH
  1191.  30H      Graphics 1 Position     1           ignored           3CCH
  1192.  38H      Graphics 2 Position     1           ignored           3CAH
  1193.  
  1194.   Note: x = B or D depending on the base I/O address;
  1195.         determined by Miscellaneous Output Register bit 1.
  1196.  
  1197.  
  1198.  
  1199.  
  1200.                                  page 20
  1201.  
  1202. Function F0: Retrieve Single Data
  1203.  
  1204. This function retrieves data from a single register.
  1205.  
  1206. Input:  AH = F0H
  1207.         BX = Index number
  1208.         DX = Port number
  1209. Return: BL = Retrieved data from EGA register
  1210.  
  1211.  
  1212. Example:
  1213.  
  1214. FUN_F0     EQU     0f0H         ; Function F0
  1215. ;
  1216. GR_CONTR   EQU     010H         ; Graphics Controller
  1217. MODE_REG   EQU     005H         ; Mode Regisiter
  1218. ;
  1219. GR1_PORT   EQU     030H         ; Graphics 1 Position Register
  1220. GR2_PORT   EQU     038H         ; Graphics 2 Position Register
  1221. ;
  1222. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1223.  
  1224.            ; Retrieve the Mode Register in Graphics Controller
  1225. MODE_REG   DB      00
  1226.            ;
  1227.            MOV     DX, GR_CONTR
  1228.            MOV     BX, MODE_REG
  1229.            MOV     AH, FUN_F0
  1230.            INT     VIDEO
  1231.            MOV     MODE_REG, BL
  1232.  
  1233.  
  1234.            ; Retrieve Graphics 1 Position Data
  1235. GR1_POS    DB      00
  1236.            ;
  1237.            MOV     DX, GR1_POS
  1238.            MOV     AH, FUN_F0
  1239.            INT     VIDEO
  1240.            MOV     GR1_POS, NL
  1241.  
  1242.  
  1243. Function F1: Save Single Data
  1244.  
  1245. This function saves data to an EGA register.  Upon finishing a call to this
  1246. function, the BH and DX values are altered.
  1247.  
  1248. Input:  AH = F1H
  1249.         BL = Index number (Non-single register only)
  1250.            = Data (Single register only)
  1251.         BH = Data (Non-single register only)
  1252.            = Disregard (Single register only)
  1253.         DX = Port number
  1254. Return: None
  1255.  
  1256.  
  1257. Example:
  1258.  
  1259.  
  1260.                                  page 21
  1261.  
  1262. FUN_F1     EQU     0f1H         ; Function F1
  1263. ;
  1264. SEQUENCE   EQU     008H         ; Sequencer
  1265. MASK_REG   EQU     002H         ; Map Mask Register
  1266. ;
  1267. FEAT_PORT  EQU     028H         ; Feature Control Register
  1268. ;
  1269. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1270.  
  1271.            ; Save Map Mask Register of Sequencer
  1272. MAP_MASK   EQU     03H
  1273.            ;
  1274.            MOV     DX, SEQUENCE
  1275.            MOV     BL, MASK_REG
  1276.            MOV     BH, MAP_MASK
  1277.            MOV     AH, FUN_F1
  1278.            INT     VIDEO
  1279.            MOV     MAP_MASK, BL
  1280.  
  1281.  
  1282.            ; Save Feature Control Register
  1283. FEATURE    DB      02H
  1284.            ;
  1285.            MOV     DX, FEAT_PORT
  1286.            MOV     BL, FEATURE
  1287.            MOV     AH, FUN_F1
  1288.            INT     VIDEO
  1289.            MOV     FEATURE, BL
  1290.  
  1291. Function F2: Retrieve Registers on a Specified Port
  1292.  
  1293. This function retrieves data from registers on a specifiπ port.  Upon finishing
  1294. a call to this function, the CX value is altered.
  1295.  
  1296. Input:  AH = F3H
  1297.         CH = Starting index number
  1298.         CL = Number of registers
  1299.         DX = Port number
  1300.         ES:BX = Destination of returned data
  1301. Return: Returned data to destination address
  1302.  
  1303. Example:
  1304.  
  1305. FUN_F2     EQU     0f2H         ; Function F2
  1306. ;
  1307. GR_CONTR   EQU     010H         ; Graphics Controller
  1308. ;
  1309. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1310.  
  1311.  
  1312.            ; Retrieve Four Registers Data from Graphics Controller
  1313. GRAPH_POOL DB      04   DUP (0)
  1314.            ;
  1315.            MOV     DX, DS
  1316.            MOV     ES, DX
  1317.            ;
  1318.  
  1319.  
  1320.                                  page 22
  1321.  
  1322.            MOV     DX, GR_CONTR
  1323.            MOV     BX, OFFSET GRAPH_POOL
  1324.            MOV     CX, 04H
  1325.            MOV     AH, FUN_F2
  1326.            INT     VIDEO
  1327.  
  1328. Function F3: Save Registers on a Specified Port
  1329.  
  1330. This function saves data from registers on a specifiπ port.  Upon finishing a
  1331. call to this function, the BX, CX, and DX values are altered.
  1332.  
  1333. Input:  AH = F3H
  1334.         CH = Starting index number
  1335.         CL = Number of register
  1336.         DX = Port number
  1337.         ES:BX = Address source of incoming data
  1338. Return: None
  1339.  
  1340. Example:
  1341.  
  1342. FUN_F3     EQU     0f3H         ; Function F3
  1343. ;
  1344. ATTR_CONTR EQU     018H         ; Attribute Controller
  1345. ;
  1346. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1347.  
  1348.  
  1349.            ; Save Four Registers Data into Attribute Controller
  1350. PALET_DATA DB      1, 2, 4, 3
  1351.            ;
  1352.            MOV     DX, DS
  1353.            MOV     ES, DX
  1354.            ;
  1355.            MOV     DX, ATTR_CONTR
  1356.            MOV     BX, OFFSET PALET_DATA
  1357.            MOV     CX, 08
  1358.            MOV     AH, FUN_F3
  1359.            INT     VIDEO
  1360.  
  1361. Function F4: Retrieve Several Registers Data At The Same Time
  1362.  
  1363. This function retrieves data from several registers at the same time.  Upon
  1364. finishing a call to this function, the CX value is altered.
  1365.  
  1366. Input:  AH = F4H
  1367.         CX = Number of registers (more than 1)
  1368.         ES:BX = Address of register packet (each consists of 4 bytes;
  1369.                 port  address,  byte 1-2;  index number,  byte 3;
  1370.                 returned data, byte 4)
  1371. Return: Returned data is saved into byte 4
  1372.  
  1373. Example:
  1374.  
  1375. FUN_F4     EQU     0f4H         ; Function F4
  1376. ;
  1377. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1378.  
  1379.  
  1380.                                  page 23
  1381.  
  1382.             ; Retrieve Follow  Registers Data
  1383. TABLE       DW     030H         ; Graphics 1 Position Register
  1384.             DB      00          ; Single Register
  1385.             DB      00          ; Retrieved Data
  1386.             ;
  1387.             DW     010H         ; Graphics Controller
  1388.             DB      05          ; Mode Register
  1389.             DB      00          ; Retrieved Data
  1390.             ;
  1391.             ;
  1392.             MOV    DX, DS
  1393.             MOV    ES, DX
  1394.             ;
  1395.             MOV    BX, OFFSET TABLE
  1396.             MOV    CX, 02
  1397.             MOV    AH, FUN_F4
  1398.             INT    VIDEO
  1399.  
  1400.  
  1401. Function F5: Save Several Registers Data At The Same Time
  1402.  
  1403. This function saves data from several registers at the same time.  Upon
  1404. finishing a call to this function, the CX value is altered.
  1405.  
  1406. Input:  AH = F5H
  1407.         CX = Number of registers (more than 1)
  1408.         ES:BX = Address of register packet (each consists of 4 bytes;
  1409.                 port  number, byte 1-2;  index number,  byte 3;
  1410.                 output data, byte 4)
  1411. Return: None
  1412.  
  1413. Example:
  1414.  
  1415. FUN_F5     EQU     0f5H         ; Function F5
  1416. ;
  1417. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1418.  
  1419.             ; Save Follow Registers Data
  1420. TABLE       DW      20H         ; Miscellaneous
  1421.             DB      00          ; Single Register
  1422.             DB      01          ; Data
  1423.             ;
  1424.             DW      18H         ; Attribute Controller
  1425.             DB      12H         ; Color Plane Enable
  1426.             DB      07H         ; Data
  1427.             ;
  1428.             ;
  1429.             MOV    DX, DS
  1430.             MOV    ES, DX
  1431.             ;
  1432.             MOV    BX, OFFSET TABLE
  1433.             MOV    CX, 02
  1434.             MOV    AH, FUN_F5
  1435.             INT    VIDEO
  1436.  
  1437.  
  1438.  
  1439.  
  1440.                                  page 24
  1441.  
  1442. Function F6: Reset All Registers as Initial Values
  1443.  
  1444. This function resets all values to default values for the specific registers.
  1445. Function 7 sets the default values.
  1446.  
  1447. Input:  AH = F6H
  1448. Return: None
  1449.  
  1450. Example:
  1451.  
  1452. FUN_F6     EQU     0f6H         ; Function F6h
  1453. ;
  1454. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1455.  
  1456.            MOV     AH, FUN_F6
  1457.            INT     VIDEO
  1458.  
  1459. Function F7: Set Initial Values
  1460.  
  1461. This function sets the initial default values.  Upon finishing a call to this
  1462. function, the BX and DX values are altered.
  1463.  
  1464. Input:  AH = F7H
  1465.         DX = Port number
  1466.         ES:BX = Table of output data
  1467. Return: None
  1468.  
  1469. Example:
  1470.  
  1471. FUN_F7     EQU     0f7H         ; Function F7
  1472. ;
  1473. ATTR_CONTR EQU     018H         ; Attribute Controller
  1474. ;
  1475. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1476.  
  1477.            ; Setting Initial Values for the Attribute Controller
  1478. ATTR_DATA  DB      1,  2,  4,  3,  5,  6,  0,  7
  1479.            DB      0,  0,  0,  0,  0,  0,  0,  0
  1480.            DB      0,  0, 0fh, 0
  1481.            ;
  1482.            MOV     DX, DS
  1483.            MOV     ES, DX
  1484.            ;
  1485.            MOV     DX, ATTR_CONTR
  1486.            MOV     BX, OFFSET ATTR_DATA
  1487.            MOV     AH, FUN_F7
  1488.            INT     VIDEO
  1489.  
  1490. Function FA: Get Version Number of Genius Mouse Driver
  1491.  
  1492. This function will give the Genius Mouse driver version number.
  1493.  
  1494. Input:  AH = FAH
  1495.         BX = 00H
  1496. Return: ES:BX = Pointer to Genius Mouse driver version number.
  1497.  
  1498.  
  1499.  
  1500.                                  page 25
  1501.  
  1502.  
  1503.